package ml.coursedesign.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ml.coursedesign.entity.StudentSign;
import ml.coursedesign.mapper.StudentSignMapper;
import ml.coursedesign.service.StudentSignService;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class StudentSignServiceImpl extends ServiceImpl<StudentSignMapper, StudentSign> implements StudentSignService {
    @Override
    public List<StudentSign> lookSignInfo(String classid, String date) {
        QueryWrapper<StudentSign> studentSignQueryWrapper = new QueryWrapper<>();
        studentSignQueryWrapper.eq("class_id",classid);
        if(date!=null){
            studentSignQueryWrapper.like("sign_time",date);
        }
        List<StudentSign> signs = baseMapper.selectList(studentSignQueryWrapper);
        return signs;
    }
}
